home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / 3d-outline.scm.z / 3d-outline.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  4.2 KB  |  94 lines

  1. ; 3d-outlined-patterned-shadowed-and-bump-mapped-logo :)
  2. ; creates outlined border of a text with patterns
  3. ;
  4. ; The GIMP -- an image manipulation program
  5. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  6. ;
  7. ; 3d-outline creates outlined border of a text with patterns
  8. ; Copyright (C) 1998 Hrvoje Horvat
  9. ;
  10. ; This program is free software; you can redistribute it and/or modify
  11. ; it under the terms of the GNU General Public License as published by
  12. ; the Free Software Foundation; either version 2 of the License, or
  13. ; (at your option) any later version.
  14. ;
  15. ; This program is distributed in the hope that it will be useful,
  16. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. ; GNU General Public License for more details.
  19. ;
  20. ; You should have received a copy of the GNU General Public License
  21. ; along with this program; if not, write to the Free Software
  22. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. (define (script-fu-3d-outline-logo text-pattern text size font outline-blur-radius shadow-blur-radius bump-map-blur-radius noninteractive s-offset-x s-offset-y)
  25.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  26.          (text-layer (car (gimp-text img -1 0 0 text 30 TRUE size PIXELS "*" font "*" "*" "*" "*")))
  27.          (width (car (gimp-drawable-width text-layer)))
  28.          (height (car (gimp-drawable-height text-layer)))
  29.          (bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
  30.          (pattern (car (gimp-layer-new img width height RGBA_IMAGE "Pattern" 100 NORMAL)))
  31.          (old-fg (car (gimp-palette-get-foreground)))
  32.          (old-bg (car (gimp-palette-get-background))))
  33.     (gimp-image-disable-undo img)
  34.     (gimp-image-resize img width height 0 0)
  35.     (gimp-image-add-layer img pattern 1)
  36.     (gimp-image-add-layer img bg-layer 2)
  37.     (gimp-edit-fill img bg-layer)
  38.     (gimp-edit-clear img pattern)                     
  39.     (gimp-layer-set-preserve-trans text-layer FALSE)
  40.     (plug-in-gauss-iir 1 img text-layer outline-blur-radius TRUE TRUE)
  41.  
  42.     (gimp-layer-set-visible pattern FALSE)
  43.     (set! layer2 (car (gimp-image-merge-visible-layers img 1)))
  44.     (plug-in-edge 1 img layer2 2 1)
  45.     (set! layer3 (car (gimp-layer-copy layer2 TRUE)))
  46.     (gimp-image-add-layer img layer3 2)
  47.     (plug-in-gauss-iir 1 img layer2 bump-map-blur-radius TRUE TRUE)
  48.  
  49.     (gimp-selection-all img)
  50.     (gimp-patterns-set-pattern text-pattern)
  51.     (gimp-bucket-fill img pattern PATTERN-BUCKET-FILL NORMAL 100 0 FALSE 0 0)
  52.     (plug-in-bump-map noninteractive img pattern layer2 110.0 45.0 4 0 0 0 0 TRUE FALSE 0)
  53.  
  54.     (set! pattern-mask (car (gimp-layer-create-mask pattern ALPHA-MASK)))
  55.     (gimp-image-add-layer-mask img pattern pattern-mask)
  56.  
  57.     (gimp-selection-all img)
  58.     (gimp-edit-copy img layer3)
  59.     (set! floating_sel (car (gimp-edit-paste img pattern-mask 0)))
  60.     (gimp-floating-sel-anchor floating_sel)
  61.  
  62.     (gimp-image-remove-layer-mask img pattern APPLY)
  63.     (gimp-invert img layer3)
  64.     (plug-in-gauss-iir 1 img layer3 shadow-blur-radius TRUE TRUE)
  65.  
  66.     (gimp-channel-ops-offset img layer3 0 1 s-offset-x s-offset-y)
  67.  
  68.     (gimp-layer-set-visible layer2 FALSE)
  69.     (gimp-layer-set-visible pattern TRUE)
  70.     (set! final (car (gimp-image-flatten img)))
  71.     
  72.     (gimp-palette-set-background old-bg)
  73.     (gimp-palette-set-foreground old-fg)
  74.     (gimp-image-enable-undo img)
  75.     (gimp-display-new img)))    
  76.  
  77. (script-fu-register "script-fu-3d-outline-logo"
  78.                     "<Toolbox>/Xtns/Script-Fu/Logos/3D Outline"
  79.                     "Creates outlined texts with drop shadow"
  80.                     "Hrvoje Horvat (hhorvat@open.hr)"
  81.                     "Hrvoje Horvat"
  82.                     "07 April, 1998"
  83.                     ""
  84.             SF-VALUE "Text Pattern" "\"Parque #1\""
  85.                     SF-VALUE "Text String" "\"The Gimp\""
  86.                     SF-VALUE "Font Size (in pixels)" "100"
  87.                     SF-VALUE "Font" "\"Roostheavy\""
  88.                     SF-VALUE "Outline blur radius" "5"
  89.                     SF-VALUE "Shadow blur radius" "10"
  90.                     SF-VALUE "Bump-map (alpha layer) blur radius" "5"
  91.             SF-TOGGLE "Default bump-map settings" TRUE
  92.             SF-VALUE "Shadow X offset" "0"
  93.                     SF-VALUE "Shadow Y offset" "0")
  94.